import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SEntityId } from "./SEntityId";
import { SPublicMiniPlayer } from "./SPublicMiniPlayer";
type int = number;
//class SBattleApply

export class SBattleApply extends IMessageBase {
  constructor(autoreg: Boolean = false) {
    
    super();if (autoreg) {
      MessageManager.instance().regist(this);
    }
    return;
  }

  public /* override */ getType(): int {
    return this._type;
  }

  public /* override */ clone(): IMessageBase {
    return new SBattleApply();
  }

  public /* override */ __write(arg1: SerializeStream): void {
    this.toEntityId.__write(arg1);
    this.playerInfo.__write(arg1);
    return;
  }

  public /* override */ __read(arg1: SerializeStream): void {
    this.toEntityId = new SEntityId();
    this.toEntityId.__read(arg1);
    this.playerInfo = new SPublicMiniPlayer();
    this.playerInfo.__read(arg1);
    return;
  }

  public /* const */ _type: int = 122;

  public /* var */ toEntityId!: SEntityId;

  public /* var */ playerInfo!: SPublicMiniPlayer;

  public static /* var */ _regist: SBattleApply = new SBattleApply(true);
}
